import request from '@/utils/request'

// 获取所有已通过的
export function getActivityList(data) {
  return request({
    url: '/api/club_activity/',
    method: 'get',
    params: data
  })
}

// 删除活动
export function deleteActivity(id) {
  return request({
    url: '/api/club_activity/' + id + '/',
    method: 'delete'
  })
}

// 获取我有权限管理的
export function getMyActivityList(data) {
  return request({
    url: '/api/club_activity/myactivity/',
    method: 'get',
    params: data
  })
}

// 创建
export function createActivity(data) {
  return request({
    url: '/api/club_activity/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 更新
export function updateActivity(id, data) {
  return request({
    url: '/api/club_activity/' + id + '/',
    method: 'patch',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 获取详情
export function getActivityDetail(id, data) {
  return request({
    url: '/api/club_activity/' + id + '/',
    method: 'get',
    params: data
  })
}

// 获取一级审核列表
export function getFirstCheckActivity(data) {
  return request({
    url: '/api/club_activity/first_check_list/',
    method: 'get',
    params: data
  })
}

// 获取二级审核列表
export function getSecondCheckActivity(data) {
  return request({
    url: '/api/club_activity/second_check_list/',
    method: 'get',
    params: data
  })
}

// 进行一级审核
export function firstCheckActivity(id, data) {
  return request({
    url: '/api/club_activity/' + id + '/first_check/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

// 进行二级审核
export function secondCheckActivity(id, data) {
  return request({
    url: '/api/club_activity/' + id + '/second_check/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}
